<template>
  <div class="newsdetail">
          <el-row :gutter="10">
            <el-col :span="8">
                <div class="newsfenlei">
                    <h1>
                        <span><i>{{newinfo.title1}}</i>{{newinfo.minititle1}}</span>
                        <nuxt-link :to="newinfo.title11"><span>查看更多 ></span></nuxt-link>
                        
                    </h1>
                    <ul class="newsul" v-if="newinfo.type == 1">
                        <li class="newsfirst" v-for="(item,index) in newslist1" :key="index">
                            <img :src="item.thumbnail" alt="">
                            <div>
                                <nuxt-link :to="'/post/' + item.pid"><h2>{{item.name}}</h2></nuxt-link>
                                <p>{{item.createtime.slice(0,11)}}</p>
                            </div>
                        </li>
                    </ul>
                    <ul class="newsul" v-else>
                          <li class="newsfirst">
                            <nuxt-link :to="'/post/' + newslist1[0].pid">
                                <img :src="newslist1[0].thumbnail" alt="">
                                <div>
                                    <h2>{{newslist1[0].name}}</h2>
                                    <p>{{newslist1[0].createtime.slice(0,11)}}</p>
                                </div>
                            </nuxt-link>
                        </li>
                        <li class="newssecond" v-for="(item,index) in newslist1" :key="index" v-if="index !=0">
                            <nuxt-link :to="'/post/' + item.pid"><h2>{{item.name}}</h2></nuxt-link>
                            <p><span>{{newslist1[0].createtime.slice(0,11)}}</span><span>阅读：{{item.readNum}}</span></p>
                        </li>
                    </ul>
                </div>
            </el-col>
            <el-col :span="8">
                    <div class="newsfenlei">
                    <h1>
                        <span><i>{{newinfo.title2}}</i>{{newinfo.minititle2}}</span>
                        <nuxt-link :to="newinfo.title22"><span>查看更多 ></span></nuxt-link>
                    
                    </h1>
                    <ul class="newsul" v-if="newinfo.type == 1">
                        <li class="newsfirst" v-for="(item,index) in newslist2" :key="index">
                            <img :src="item.thumbnail" alt="">
                            <div>
                                <nuxt-link :to="'/post/' + item.pid"><h2>{{item.name}}</h2></nuxt-link>
                                <p>{{item.createtime.slice(0,11)}}</p>
                            </div>
                        </li>
                    </ul>
                     <ul class="newsul" v-else>
                          
                          <li class="newsfirst">
                            <nuxt-link :to="'/post/' + newslist2[0].pid">
                                <img :src="newslist2[0].thumbnail" alt="">
                                <div>
                                    <h2>{{newslist2[0].name}}</h2>
                                    <p>{{newslist2[0].createtime.slice(0,11)}}</p>
                                </div>
                            </nuxt-link>
                        </li>
                        <li class="newssecond" v-for="(item,index) in newslist2" :key="index" v-if="index !=0">
                            <nuxt-link :to="'/post/' + item.pid"><h2>{{item.name}}</h2></nuxt-link>
                            <p><span>{{newslist1[0].createtime.slice(0,11)}}</span><span>阅读：{{item.readNum}}</span></p>
                        </li>
                    </ul>
                </div>
            </el-col>
            <el-col :span="8">
                    <div class="newsfenlei">
                    <h1>
                        <span><i>{{newinfo.title3}}</i>{{newinfo.minititle3}}</span>
                        <nuxt-link :to="newinfo.title33"><span>查看更多 ></span></nuxt-link>
                       
                    </h1>
                    <ul class="newsul" v-if="newinfo.type == 1">
                        <li class="newsfirst" v-for="(item,index) in newslist3" :key="index">
                            <img :src="item.thumbnail" alt="">
                            <div>
                                <nuxt-link :to="'/post/' + item.pid"><h2>{{item.name}}</h2></nuxt-link>
                                <p>{{item.createtime.slice(0,11)}}</p>
                            </div>
                        </li>
                    </ul>
                   <ul class="newsul" v-else>
                          <li class="newsfirst">
                               <nuxt-link :to="'/post/' + newslist3[0].pid">
                                        <img :src="newslist3[0].thumbnail" alt="">
                                        <div>
                                            <h2>{{newslist3[0].name}}</h2>
                                            <p>{{newslist3[0].createtime.slice(0,11)}}</p>
                                        </div>
                               </nuxt-link>
                        </li>
                        <li class="newssecond" v-for="(item,index) in newslist3" :key="index" v-if="index !=0">
                            <nuxt-link :to="'/post/' + item.pid"><h2>{{item.name}}</h2></nuxt-link>
                            <p><span>{{newslist1[0].createtime.slice(0,11)}}</span><span>阅读：{{item.readNum}}</span></p>
                        </li>
                    </ul>
                </div>
            </el-col>
          </el-row>
  </div>
</template>

<script>
export default {
  props: {
    newinfo: {
      type:Object,
      default:function(){
        return {}
      }
    },
    newslist1:{
      type:Array,
      default:function(){
        return []
      }
    },
    newslist2:{
      type:Array,
      default:function(){
        return []
      }
    },
    newslist3:{
      type:Array,
      default:function(){
        return []
      }
    }
  }
};
</script>

<style scoped>
.newsdetail{
    width: 1200px;
    margin: 10px auto;
}
.newsfenlei{
    overflow: hidden;
    padding: 0 20px 20px;
    background: white;
}
.newsfenlei h1{
    display: flex;
    justify-content: space-between;
    height: 50px;
    border-bottom: 1px solid #ccc;
    line-height: 50px;
}
.newsfenlei h1 span:nth-child(1) i{
    color: #cd9c54;
    font-size: 20px;
}
.newsfenlei h1 span:nth-child(1){
    color: #ccc;
    font-size: 12px;
}
.newsfenlei h1 a span:nth-child(1){
    color: black;
    font-size: 12px;
    
}
.newsfenlei h1 span:nth-child(2){
    color: #666;
    font-size: 14px;
}
.newsfirst{
    height: 70px;
    margin: 10px 0;
}
.newsfirst img{
    height: 70px;
    width: 120px;
    float: left;
}
.newsfirst div{
    float: left;
    height: 70px;
    width: 228px;
}
.newsfirst h2{
    font-size: 16px;
    color: #333;
    width: 100%;
    overflow: hidden;
     white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 10px;
    padding-left: 10px;
}
.newsfirst p{
    font-size: 14px;
    color: #666666;
    margin-top: 20px;
    padding-left: 10px;
    
}
.newssecond{
    height: 76px;
    overflow: hidden;
    border-bottom: 1px solid #ccc;    
}
.newssecond h2{
     font-size: 16px;
    color: #333;
    width: 96%;
    overflow: hidden;
     white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 20px;
    padding-left: 10px;
}   
.newssecond p{
    font-size: 14px;
    color: #666666;
    margin-top: 10px;
    padding-left: 10px;
    
}
.newssecond p span:nth-child(2){
    margin-left: 20px;
}
</style>

